package cn.littlehx.myweb.service.utils.impl;

import cn.littlehx.myweb.service.utils.MyUtils;
import org.springframework.stereotype.Component;
import org.springframework.util.DigestUtils;

import java.nio.charset.StandardCharsets;

@Component
public class MyUtilsImpl implements MyUtils {
    @Override
    public String encode(String password) {
        return DigestUtils.md5DigestAsHex(password.getBytes(StandardCharsets.UTF_8));
    }
}
